<?php
if(isset($_GET['uid'])) {
	$uid=$_GET['uid'];
	$user_file = "users/".md5($uid)."/settings.json";
	$users = json_decode(file_get_contents($user_file),true);
	$users['lastonline'] = time();
	file_put_contents("$user_file",json_encode($users));
	touch("online/$uid");
	echo "online";
}
else {
	echo "offline";
}
?>
